﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LucyGrid;
using System.Threading;

namespace ConsoleAppTest
{
	class Program
	{
		static void Main(string[] args)
		{
			Listen();
			Test();
			Console.ReadLine();

		}
		static void Listen()
		{
			new GridComm().StartListener((m) => System.Console.WriteLine(m));
		}
		static void Test(){
			// new GridComm().EmitStopAll();

			Enumerable.Range(0, 3)
			.AsParallelGrid(i =>
			{
				var now = DateTime.Now;
				Thread.Sleep(1000);
				return new
				{
					Start = now,
					End = DateTime.Now
				};
			})
			.GroupBy(e => e.Start.Minute)
			.ToArray();
		}
	}
}
